package com.example.program.controller;

import com.example.program.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
//全局异常处理
@RestControllerAdvice
public class ycbg {
@ExceptionHandler
    public Result ex(Exception e)
    {
        e.printStackTrace();
        return  Result.error("对不起,操作失败,请联系管理员");
    }
}
